﻿package com.pandemicode.framework.smtp.mailer {
	
	/**
	* @author Mike Lawrence
	*/
	public class Response {
		public var code:Number;
		public var message:String;
		public function get meaning():String {
			switch(this.code) {
				case 200: return "(nonstandard success response, see rfc876)";
				case 211: return "System status, or system help reply";
				case 214: return "Help message";
				case 220: return "<domain> Service ready";
				case 221: return "<domain> Service closing transmission channel";
				case 250: return "Requested mail action okay, completed";
				case 251: return "User not local; will forward to <forward-path>";
				case 354: return "Start mail input; end with <CRLF>.<CRLF>";
				case 421: return "<domain> Service not available, closing transmission channel";
				case 450: return "Requested mail action not taken: mailbox unavailable";
				case 451: return "Requested action aborted: local error in processing";
				case 452: return "Requested action not taken: insufficient system storage";
				case 500: return "Syntax error, command unrecognised";
				case 501: return "Syntax error in parameters or arguments";
				case 502: return "Command not implemented";
				case 503: return "Bad sequence of commands";
				case 504: return "Command parameter not implemented";
				case 521: return "<domain> does not accept mail (see rfc1846)";
				case 530: return "Access denied (???a Sendmailism)";
				case 550: return "Requested action not taken: mailbox unavailable";
				case 551: return "User not local; please try <forward-path>";
				case 552: return "Requested mail action aborted: exceeded storage allocation";
				case 553: return "Requested action not taken: mailbox name not allowed";
				case 554: return "Transaction failed";
				default: return "<unknown>";
			}
		}
		
		public function Response(code:Number, message:String) {
			this.code = code;
			this.message = message;
		}
	}
}
